<?php

namespace App\Services\Sms;

final class SmsSendResult
{
    public function __construct(
        private bool $success,
        private ?string $messageId = null,
        private ?string $message = null,
        private array $context = []
    ) {
    }

    public static function success(?string $messageId = null, array $context = []): self
    {
        return new self(true, $messageId, null, $context);
    }

    public static function failure(string $message, array $context = []): self
    {
        return new self(false, null, $message, $context);
    }

    public function isSuccess(): bool
    {
        return $this->success;
    }

    public function getMessageId(): ?string
    {
        return $this->messageId;
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function getContext(): array
    {
        return $this->context;
    }
}
